/**
 * This script contains tests for the FlyTED Sparql Endpoint.
 * @author Alistair Miles
 * @author Jun Zhao
 */

// convenience variables
var Assert = YAHOO.util.Assert;
var log = YAHOO.log;
var JSON = YAHOO.lang.JSON;
var sparqlns = "PREFIX owl: <http://www.w3.org/2002/07/owl#> ";
sparqlns += "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> ";
sparqlns += "PREFIX go: <http://purl.org/obo/owl/GO#> ";
sparqlns += "PREFIX oban: <http://www.berkeleybop.org/ontologies/oban/alpha#> ";
sparqlns += "PREFIX vocab: <http://serifos.zoo.ox.ac.uk/bdgp/resource/vocab/> ";
sparqlns += "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> ";
sparqlns += "PREFIX : <http://www.geneontology.org/owl#> ";
sparqlns += "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ";
sparqlns += "PREFIX dc: <http://purl.org/dc/elements/1.1/> ";
sparqlns += "PREFIX digitalmedia: <http://www.mindswap.org/2005/owl/digital-media#> ";
sparqlns += "PREFIX map: <file:/C:/oxford/d2r-server-0.4/d2r-server-0.4/mapping.n3#> ";
sparqlns += "PREFIX skos: <http://www.w3.org/2004/02/skos/core#> ";
sparqlns += "PREFIX oborel: <http://www.obofoundry.org/ro/ro.owl#> ";
sparqlns += "PREFIX insitu: <http://www.fruitfly.org/insituimages/insitu_images/thumbnails> ";
sparqlns += "PREFIX db: <http://serifos.zoo.ox.ac.uk/bdgp/resource/> ";
sparqlns += "PREFIX obo: <http://purl.org/obo/owl> ";
sparqlns += "PREFIX genomics: <http://www.berkeleybop.org/ontologies/genomics/alpha#> ";

/**
 * @class
 */
function tests() {}


/**
 * TODO doc me
 */
function testEndpointExists(testCase) {
	log("==== testEndpointExists ====");
	
	// define the callback object
	var callback = {
		success: testEndpointExistsResponseSuccess(testCase),
		failure: testEndpointExistsResponseFailure(testCase)
	};
	
	log("Make the request");
	var request = YAHOO.util.Connect.asyncRequest("GET", "bdgp", callback, null);
	
	log("Suspend the test runner");
	testCase.wait();
	
}

tests.testEndpointExists = testEndpointExists;


/**
 * TODO doc me
 */
function testEndpointHasData(testCase) {
	log("==== testEndpointHasData ====");

	var query = "ASK { ?subject ?predicate ?object }";
	testAskQuery("bdgp", testCase, query, true, "Endpoint has no data.");
	
}

tests.testEndpointHasData = testEndpointHasData;


/**
 * TODO doc me
 */
function testEndpointHasGeneProductsWithLabels(testCase) {
	log("==== testEndpointHasGeneProductsWithLabels ====");

	var query = "ASK { ?gp skos:altLabel ?gene }";
	testAskQuery("bdgp", testCase, query, true, "Endpoint has no gene products with labels.");
	
}

tests.testEndpointHasGeneProductsWithLabels = testEndpointHasGeneProductsWithLabels;


/**
 * TODO doc me
 */
function testEndpointHasImageURLWithGeneCG10151(testCase) {
	log("==== testEndpointHasImageURLWithGeneCG10151 ====");
	
	// define the SPARQL SELECT query & URL
	var query = "ASK {?img digitalmedia:depicts [ oban:has_participants_from [ skos:altLabel \"CG10151\" ] ]}";
	testAskQuery("bdgp", testCase, query, true, "Endpoint has no image URLs for gene CG10151.");
			
}

tests.testEndpointHasImageURLWithGeneCG10151 = testEndpointHasImageURLWithGeneCG10151;


/**
 * TODO doc me
 */
function testEndpointHasNoGeneProductsWithoutLabels( testCase ) {
	log("==== testEndpointHasNoGeneProductsWithoutLabels ====");

	var query = 	"ASK { "+
//					"	?img digitalmedia:depicts ?expression ." + // not needed?
					"	?expression oban:has_participants_from ?product ." +
					"	OPTIONAL {" +
					"		?product skos:altLabel ?label " +
					"	}" +
					"	FILTER (!bound(?label))" +
					"}";
					
	testAskQuery("bdgp", testCase, query, false, "Endpoint has gene products without labels.");
	
}

tests.testEndpointHasNoGeneProductsWithoutLabels = testEndpointHasNoGeneProductsWithoutLabels;



/**
 * TODO doc me
 */
function testEndpointHasNoGeneProductsWithoutLabelAndLogNumberWithout(testCase){

	log("==== testEndpointHasNoGeneProductsWithoutLabelAndLogNumberWithout ====");
	
	var query = 	"SELECT DISTINCT ?product WHERE { "+
//						"?img digitalmedia:depicts ?expression . " + // not needed?
						"?expression oban:has_participants_from ?product . " +
						"OPTIONAL { " +
							"?product skos:altLabel ?label " +
						"} " +
						"FILTER (!bound(?label)) " +
					"}";

	var failureMessage = "There should be 0 gene products without label.";
	
	var callback = {
			success: testSelectQueryExpectNumBindingsResponseSuccess(testCase, 0, failureMessage),
			failure: genericResponseFailure(testCase)
		};
		
	// define SPARQL query & URL
	query = sparqlns + query;
	var url = "bdgp?output=json&query=" + escape(query);
	log("Unescaped query: "+query);
		
	log("Make the request to "+url);
	var request = YAHOO.util.Connect.asyncRequest("GET", url, callback, null);
		
	log("Suspend the test runner");
	testCase.wait();
}

tests.testEndpointHasNoGeneProductsWithoutLabelAndLogNumberWithout = testEndpointHasNoGeneProductsWithoutLabelAndLogNumberWithout;



/**
 * TODO doc me
 */
function testEndpointHasNoExpressionsWithoutGeneProducts( testCase ) {
	log("==== testEndpointHasNoExpressionsWithoutGeneProducts ====");

	var query = 	"ASK { "+
					"	?img digitalmedia:depicts ?expression ." + 
					"	OPTIONAL {" +
					"		?expression oban:has_participants_from ?product ." +
					"	}" +
					"	FILTER (!bound(?product))" +
					"}";
					
	testAskQuery("bdgp", testCase, query, false, "Endpoint has expression events without gene products.");
	
}

tests.testEndpointHasNoExpressionsWithoutGeneProducts = testEndpointHasNoExpressionsWithoutGeneProducts;


/**
 * TODO doc me
 */
function testEndpointHasGeneProductsWithFlybaseID( testCase ) {
	log("==== testEndpointHasGeneProductsWithFlybaseID ====");

	var query = 	"ASK { " +
						"?img digitalmedia:depicts ?expression . " + // not needed?
						"?expression oban:has_participants_from ?product . " +
						"?product skos:altLabel ?label ." +
						"FILTER regex(?label, '^FBgn') " + 
					"}";	
}

tests.testEndpointHasGeneProductsWithFlybaseID = testEndpointHasGeneProductsWithFlybaseID;


/**
 * TODO doc me
 */
function testEndpointHasNoGeneProductsWithoutFlybaseID( testCase ) {
	log("==== testEndpointHasNoGeneProductsWithoutFlybaseID ====");
	
	var query = 	"ASK { "+
//						"?img digitalmedia:depicts ?expression . " + // not needed?
						"?expression oban:has_participants_from ?product . " +
						"OPTIONAL { " +
							"?product skos:altLabel ?fbgn " +
							"FILTER regex(?fbgn, '^FBgn') " + 
						"} " +
						"FILTER (!bound(?fbgn)) " +
					"}";
					
	testAskQuery("bdgp", testCase, query, false, "Endpoint has gene products without flybase IDs.");

}

tests.testEndpointHasNoGeneProductsWithoutFlybaseID = testEndpointHasNoGeneProductsWithoutFlybaseID;


/**
 * TODO doc me
 */
function testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogNumberWithout(testCase){

	log("==== testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogNumberWithout ====");
	
	var query = 	"SELECT DISTINCT ?product WHERE { "+
//						"?img digitalmedia:depicts ?expression . " + // not needed?
						"?expression oban:has_participants_from ?product . " +
						"OPTIONAL { " +
							"?product skos:altLabel ?fbgn " +
							"FILTER regex(?fbgn, '^FBgn') " + 
						"} " +
						"FILTER (!bound(?fbgn)) " +
					"}";

	var failureMessage = "There should be 0 gene products without flybase id label.";
	
	var callback = {
			success: testSelectQueryExpectNumBindingsResponseSuccess(testCase, 0, failureMessage),
			failure: genericResponseFailure(testCase)
		};
		
	// define SPARQL query & URL
	query = sparqlns + query;
	var url = "bdgp?output=json&query=" + escape(query);
	log("Unescaped query: "+query);
		
	log("Make the request to "+url);
	var request = YAHOO.util.Connect.asyncRequest("GET", url, callback, null);
		
	log("Suspend the test runner");
	testCase.wait();
}

tests.testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogNumberWithout = testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogNumberWithout;


function testEndpointHasNoGeneProductsWithSomeLabelButWithoutFlybaseIDAndLogNumberWithout(testCase) {
	log("==== testEndpointHasNoGeneProductsWithSomeLabelButWithoutFlybaseIDAndLogNumberWithout ====");
	
	var query = 	"SELECT DISTINCT ?product WHERE { "+
//						"?img digitalmedia:depicts ?expression . " + // not needed?
						"?expression oban:has_participants_from ?product . " +
						"?product skos:altLabel ?label ." +
						"OPTIONAL { " +
							"?product skos:altLabel ?fbgn " +
							"FILTER regex(?fbgn, '^FBgn') " + 
						"} " +
						"FILTER (!bound(?fbgn)) " +
					"}";

	var failureMessage = "There should be 0 gene products with some label but without flybase id label.";
	
	var callback = {
			success: testSelectQueryExpectNumBindingsResponseSuccess(testCase, 0, failureMessage),
			failure: genericResponseFailure(testCase)
		};
		
	// define SPARQL query & URL
	query = sparqlns + query;
	var url = "bdgp?output=json&query=" + escape(query);
	log("Unescaped query: "+query);
		
	log("Make the request to "+url);
	var request = YAHOO.util.Connect.asyncRequest("GET", url, callback, null);
		
	log("Suspend the test runner");
	testCase.wait();
	
}

tests.testEndpointHasNoGeneProductsWithSomeLabelButWithoutFlybaseIDAndLogNumberWithout = testEndpointHasNoGeneProductsWithSomeLabelButWithoutFlybaseIDAndLogNumberWithout;


/**
 * TODO doc me
 */
function testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures( testCase ) {
	log("==== testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures ====");
	
//	var query = 	"SELECT * WHERE { "+
//						"?product skos:altLabel ?label " +
////						"?expression oban:has_participants_from ?product . " +
////						"OPTIONAL { " +
////							"?product skos:altLabel ?label " +
////						"} " +
//						"OPTIONAL { " +
//							"?product skos:altLabel ?fbgn " +
//							"FILTER regex(?fbgn, '^FBgn') " + // TODO check this
//						"} " +
//						"FILTER (!bound(?fbgn)) " +
////						"?img digitalmedia:depicts ?expression . " + // not needed?
//					"}";

	var query = 	"SELECT DISTINCT ?product WHERE { "+
//						"?img digitalmedia:depicts ?expression . " + // not needed?
						"?expression oban:has_participants_from ?product . " +
						"OPTIONAL { " +
							"?product skos:altLabel ?fbgn " +
							"FILTER regex(?fbgn, '^FBgn') " + 
						"} " +
						"FILTER (!bound(?fbgn)) " +
					"}";
					
	testSelectQueryExpectNoBindings("bdgp", testCase, query, "Endpoint has gene products without flybase IDs, see logs for bindings.");

}

tests.testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures = testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures;


function testNumberOfImages(testCase) {
	log("==== testNumberOfImages ====");
	
	var query = 	"SELECT DISTINCT ?image WHERE { " +
						"?image digitalmedia:depicts ?something . " +
					"}";

	var failureMessage = "There should be 74,612 images.";
	
	var callback = {
			success: testSelectQueryExpectNumBindingsResponseSuccess(testCase, 74612, failureMessage),
			failure: genericResponseFailure(testCase)
		};
		
	// define SPARQL query & URL
	query = sparqlns + query;
	var url = "bdgp?output=json&query=" + escape(query);
	log("Unescaped query: "+query);
		
	log("Make the request to "+url);
	var request = YAHOO.util.Connect.asyncRequest("GET", url, callback, null);
		
	log("Suspend the test runner");
	testCase.wait();
	
}

tests.testNumberOfImages = testNumberOfImages;


/**
 * TODO doc me
 */
var bdgpTestCase = new YAHOO.tool.TestCase({

	name: "BDGP SPARQL Endpoint Test Case",
	
	testEndpointExists : function() {
		testEndpointExists(this);
	},
	
	testEndpointHasData : function() {
		testEndpointHasData(this);
	},
	
	testEndpointHasGeneProductsWithLabels : function(){
		testEndpointHasGeneProductsWithLabels(this);
	},

	testEndpointHasImageURLWithGeneCG10151 : function() {
		testEndpointHasImageURLWithGeneCG10151(this);
	},
	
	testEndpointHasNoGeneProductsWithoutLabels : function() {
		testEndpointHasNoGeneProductsWithoutLabels(this);
	},

	testEndpointHasNoGeneProductsWithoutLabelAndLogNumberWithout : function() {
		testEndpointHasNoGeneProductsWithoutLabelAndLogNumberWithout(this);
	},
		
	testEndpointHasNoExpressionsWithoutGeneProducts : function() {
		testEndpointHasNoExpressionsWithoutGeneProducts(this);
	},

	testEndpointHasGeneProductsWithFlybaseID : function() {
		testEndpointHasGeneProductsWithFlybaseID(this);
	},
	
	testEndpointHasNoGeneProductsWithoutFlybaseID : function() {
		testEndpointHasNoGeneProductsWithoutFlybaseID(this);
	},
	
	testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogNumberWithout : function() {
		testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogNumberWithout(this);
	},
	
	testEndpointHasNoGeneProductsWithSomeLabelButWithoutFlybaseIDAndLogNumberWithout : function() {
		testEndpointHasNoGeneProductsWithSomeLabelButWithoutFlybaseIDAndLogNumberWithout(this);
	},
	
	testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures : function() {
		testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures(this);
	},
	
	testNumberOfImages : function() {
		testNumberOfImages(this);
	}
	
})	


/**
 * TODO doc me
 */
function setupLogger() {
    var loggerConfig = {
        thresholdMax : 100000,
        thresholdMin : 100000
    };
    var loggerContainer = document.getElementById("logger");
    var testLogger = new YAHOO.tool.TestLogger(loggerContainer, loggerConfig);
//	var logReader = new YAHOO.tool.TestLogger("logger");
	YAHOO.log("Logger setup done");	
}


/**
 * TODO doc me
 */
function runTests() {
	YAHOO.log("Running tests");
	YAHOO.tool.TestRunner.add(bdgpTestCase);
	YAHOO.tool.TestRunner.run();
}


/**
 * TODO doc me
 */
function runTest(testName) {
	var fn = tests[testName];
	if (typeof fn != "undefined" || fn) {
		var tfn = function() {fn(this)};
		var to = {
			name : testName
		};
		to[testName] = tfn;
		var testCase = new YAHOO.tool.TestCase(to);
		YAHOO.tool.TestRunner.clear();
		YAHOO.tool.TestRunner.add(testCase);
		YAHOO.tool.TestRunner.run();
	}
}


YAHOO.util.Event.onDOMReady(setupLogger);
//YAHOO.util.Event.onDOMReady(runTests);


/*
run on 2008-08-29 ...

INFO ==== testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures ====

INFO Unescaped query: PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX go: <http://purl.org/obo/owl/GO#> PREFIX oban: <http://www.berkeleybop.org/ontologies/oban/alpha#> PREFIX vocab: <http://serifos.zoo.ox.ac.uk/bdgp/resource/vocab/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX : <http://www.geneontology.org/owl#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX digitalmedia: <http://www.mindswap.org/2005/owl/digital-media#> PREFIX map: <file:/C:/oxford/d2r-server-0.4/d2r-server-0.4/mapping.n3#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX oborel: <http://www.obofoundry.org/ro/ro.owl#> PREFIX insitu: <http://www.fruitfly.org/insituimages/insitu_images/thumbnails> PREFIX db: <http://serifos.zoo.ox.ac.uk/bdgp/resource/> PREFIX obo: <http://purl.org/obo/owl> PREFIX genomics: <http://www.berkeleybop.org/ontologies/genomics/alpha#> SELECT * WHERE { ?product skos:altLabel ?label OPTIONAL { ?product skos:altLabel ?fbgn FILTER regex(?fbgn, '^FBgn') } FILTER (!bound(?fbgn)) }

INFO Make the request to bdgp?output=json&query=PREFIX%20owl%3A%20%3Chttp%3A//www.w3.org/2002/07/owl%23%3E%20PREFIX%20xsd%3A%20%3Chttp%3A//www.w3.org/2001/XMLSchema%23%3E%20PREFIX%20go%3A%20%3Chttp%3A//purl.org/obo/owl/GO%23%3E%20PREFIX%20oban%3A%20%3Chttp%3A//www.berkeleybop.org/ontologies/oban/alpha%23%3E%20PREFIX%20vocab%3A%20%3Chttp%3A//serifos.zoo.ox.ac.uk/bdgp/resource/vocab/%3E%20PREFIX%20rdfs%3A%20%3Chttp%3A//www.w3.org/2000/01/rdf-schema%23%3E%20PREFIX%20%3A%20%3Chttp%3A//www.geneontology.org/owl%23%3E%20PREFIX%20rdf%3A%20%3Chttp%3A//www.w3.org/1999/02/22-rdf-syntax-ns%23%3E%20PREFIX%20dc%3A%20%3Chttp%3A//purl.org/dc/elements/1.1/%3E%20PREFIX%20digitalmedia%3A%20%3Chttp%3A//www.mindswap.org/2005/owl/digital-media%23%3E%20PREFIX%20map%3A%20%3Cfile%3A/C%3A/oxford/d2r-server-0.4/d2r-server-0.4/mapping.n3%23%3E%20PREFIX%20skos%3A%20%3Chttp%3A//www.w3.org/2004/02/skos/core%23%3E%20PREFIX%20oborel%3A%20%3Chttp%3A//www.obofoundry.org/ro/ro.owl%23%3E%20PREFIX%20insitu%3A%20%3Chttp%3A//www.fruitfly.org/insituimages/insitu_images/thumbnails%3E%20PREFIX%20db%3A%20%3Chttp%3A//serifos.zoo.ox.ac.uk/bdgp/resource/%3E%20PREFIX%20obo%3A%20%3Chttp%3A//purl.org/obo/owl%3E%20PREFIX%20genomics%3A%20%3Chttp%3A//www.berkeleybop.org/ontologies/genomics/alpha%23%3E%20SELECT%20*%20WHERE%20%7B%20%3Fproduct%20skos%3AaltLabel%20%3Flabel%20OPTIONAL%20%7B%20%3Fproduct%20skos%3AaltLabel%20%3Ffbgn%20FILTER%20regex%28%3Ffbgn%2C%20%27%5EFBgn%27%29%20%7D%20FILTER%20%28%21bound%28%3Ffbgn%29%29%20%7D

INFO Suspend the test runner

INFO Request success

INFO Resumed test runner

INFO Parse the response text

INFO Test if SELECT returns any unexpected bindings
 
ERROR Found 39 unexpected bindings.

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/5511"},"label":{"type":"literal","value":"FBti0019622"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3147"},"label":{"type":"literal","value":"roo{}311"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/17"},"label":{"type":"literal","value":"1360{}505"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/731"},"label":{"type":"literal","value":"TE18870"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2706"},"label":{"type":"literal","value":"opus{}1381"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2707"},"label":{"type":"literal","value":"opus{}1381"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2705"},"label":{"type":"literal","value":"TE19139"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3336"},"label":{"type":"literal","value":"copia{}837"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3649"},"label":{"type":"literal","value":"copia{}997"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3648"},"label":{"type":"literal","value":"copia{}997"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/17"},"label":{"type":"literal","value":"FBti0019842"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2705"},"label":{"type":"literal","value":"FBti0019139"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/731"},"label":{"type":"literal","value":"FBti0018870"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/731"},"label":{"type":"literal","value":"412{}878"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2707"},"label":{"type":"literal","value":"TE19396"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2706"},"label":{"type":"literal","value":"TE19396"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/1379"},"label":{"type":"literal","value":"TE19881"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3336"},"label":{"type":"literal","value":"TE18968"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3649"},"label":{"type":"literal","value":"TE20108"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3648"},"label":{"type":"literal","value":"TE20108"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3648"},"label":{"type":"literal","value":"FBti0020108"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3649"},"label":{"type":"literal","value":"FBti0020108"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/1379"},"label":{"type":"literal","value":"diver2{}580"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2708"},"label":{"type":"literal","value":"TE20391"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2708"},"label":{"type":"literal","value":"Stalker4{}1446"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/5511"},"label":{"type":"literal","value":"TE19622"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3628"},"label":{"type":"literal","value":"R1-element{}1519"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2706"},"label":{"type":"literal","value":"FBti0019396"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2707"},"label":{"type":"literal","value":"FBti0019396"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3336"},"label":{"type":"literal","value":"FBti0018968"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3628"},"label":{"type":"literal","value":"TE19493"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3628"},"label":{"type":"literal","value":"FBti0019493"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/17"},"label":{"type":"literal","value":"TE19842"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3147"},"label":{"type":"literal","value":"TE19126"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/1379"},"label":{"type":"literal","value":"FBti0019881"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2705"},"label":{"type":"literal","value":"Tirant{}328"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/5511"},"label":{"type":"literal","value":"gypsy5{}103"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/2708"},"label":{"type":"literal","value":"FBti0020391"}}

ERROR Found unexpected binding: {"product":{"type":"uri","value":"http://serifos.zoo.ox.ac.uk/bdgp/gene_product/3147"},"label":{"type":"literal","value":"FBti0019126"}}

FAIL testEndpointHasNoGeneProductsWithoutFlybaseIDAndLogFailures: Endpoint has gene products without flybase IDs, see logs for bindings.





*/